package org.bjf.modules.shardDemo.controller;

import java.time.LocalDateTime;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.bjf.modules.user.bean.User;
import org.bjf.modules.user.service.ShardDemoService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class TestController {


  @Resource
  private ShardDemoService shardDemoService;

  @RequestMapping("test/user/{id}")
  public User detail(@PathVariable long id) {
    return shardDemoService.get(id);
  }

  @RequestMapping("test/log")
  public Object logger() {
    LocalDateTime now = LocalDateTime.now();
    log.warn("time:" + now);
    return now;
  }


}
